package sky.com.util
{
	import flash.events.Event;
	import flash.media.Sound;
	import flash.media.SoundChannel;
	import flash.net.URLRequest;
	
	import mx.controls.Alert;

	public class MySound
	{
		private var _url:String;
		private var _sound:Sound;
		private var _urlRequest:URLRequest;
		private var _soundChannel:SoundChannel;
		public function MySound(url:String)
		{
			_url=url;
		}
		
		public function getSound():Sound{			
			_sound=new Sound(new URLRequest(_url));
			return _sound;
		}
		

		
//		public function playSound():void{
//			_urlRequest=new URLRequest(_url);	
//			_sound=new Sound(_urlRequest);			
//			_soundChannel=_sound.play();
//			_soundChannel.addEventListener(Event.SOUND_COMPLETE,playSoundComplete);		
//		}
//		
//		private function playSoundComplete(e:Event):void{
//			_soundChannel.removeEventListener(Event.SOUND_COMPLETE,playSoundComplete);
//			_soundChannel=_sound.play();
//			_soundChannel.addEventListener(Event.SOUND_COMPLETE,playSoundComplete);	
//	
//		}
	}
}